<div ng-controller="KefuCtrl" ng-init="addAction()" class="sui-form form-horizontal">
    <!-- <form name="fxgradeForm" novalidate ng-submit="kefuAdd()"> -->
    <ul class="sui-breadcrumb">
        <li>
            <a href="#/kefu/list">{{'客服消息设置' | translate}}</a>
        </li>
        <li class="active">{{'edit' | translate}}</li>
        <li class="active" ng-show="config.service_type_id ==1">
        </li>
    </ul>
    <div>
        <!-- <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">{{'进入会话自动回复是否开启' | translate}}:</label>
            <div class="controls">
                <label>
                    <input type="radio" name="session_reply_open" ng-model="config.session_reply_open" ng-value="1" class="input-xlarge" required />是 </label>
                </label>
                <label>
                    <input type="radio" name="session_reply_open" ng-model="config.session_reply_open" ng-value="0" class="input-xlarge" required />否 </label>
                </label>
            </div>
        </div>
        <div class="control-group" ng-if="config.session_reply_open">
            <label class="control-label v-top" style="width: 160px;">选择类型:</label>
            <div class="controls">
                <label>
                    <input type="radio" name="session_reply_type" ng-model="config.session_reply_type" ng-value="'text'" class="input-xlarge" required />文字 </label>
                <label>
                    <input type="radio" name="session_reply_type" ng-model="config.session_reply_type" ng-value="'image'" class="input-xlarge" required />图片 </label>
                <label>
                    <input type="radio" name="session_reply_type" ng-model="config.session_reply_type" ng-value="'link'" class="input-xlarge" required />加微信 </label>
            </div>
        </div>
        <div ng-if="config.session_reply_open">
            <div ng-show="config.session_reply_type=='text'" class="control-group">
                <label class="control-label v-top" style="width: 150px;">内容:</label>
                <div class="controls">
                    <textarea rows="3" ng-model="config.session_reply_info.content" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                </div>
            </div>
            <div ng-show="config.session_reply_type=='image' " class="control-group">
                <label class="control-label v-top" style="width: 150px;">图片:</label>
                <div class="controls">
                    <kefu-img ng-model="config.session_reply_info.media_id" appid="wxapp_id" apply-type="session_reply_info"></kefu-img>
                </div>
            </div>
            <div ng-show="config.session_reply_type=='link' ">
                <div class="control-group">
                    <label class="control-label v-top" style="width: 150px;">标题:</label>
                    <div class="controls">
                        <input ng-model="config.session_reply_info.title" type="text" value="" class="input-xlarge">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label v-top" style="width: 150px;">消息内容:</label>
                    <div class="controls">
                        <textarea rows="3" ng-model="config.session_reply_info.description" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label v-top" style="width: 150px;">客服二维码:</label>
                    <div class="controls">
                        <attachment owner-id="1" owner-type="item" dhf-ng-model="config.session_reply_info.thumb_url" xtype="url" mult="false" title="Upload" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"></attachment>
                        <img ng-src="{{config.session_reply_info.thumb_url}}" style="width:200px;height: 170px">
                    </div>
                </div>
            </div>
        </div> -->
        <div class="control-group">
            <label class="control-label v-top" style="width: 160px;">{{'收到消息自动回复是否开启' | translate}}:</label>
            <div class="controls">
                <label>
                    <input type="radio" name="rcvmsg_reply_open" ng-model="config.rcvmsg_reply_open" ng-value="1" class="input-xlarge" required />是
                </label>
                <label>
                    <input type="radio" name="rcvmsg_reply_open" ng-model="config.rcvmsg_reply_open" ng-value="0" class="input-xlarge" required />否
                </label>
            </div>
        </div>
        <div class="control-group" ng-if="config.rcvmsg_reply_open">
            <label class="control-label v-top" style="width: 150px;"></label>
            <div class="controls">
                <label>
                    <input type="radio" name="rcvmsg_reply_type" ng-model="config.rcvmsg_reply_type" ng-value="'text'" class="input-xlarge" required />文字 </label>
                <label>
                    <input type="radio" name="rcvmsg_reply_type" ng-model="config.rcvmsg_reply_type" ng-value="'image'" class="input-xlarge" required />图片 </label>
                <label>
                    <input type="radio" name="rcvmsg_reply_type" ng-model="config.rcvmsg_reply_type" ng-value="'link'" class="input-xlarge" required />加微信 </label>
            </div>
        </div>
        <div ng-if="config.rcvmsg_reply_open">
            <div ng-show="config.rcvmsg_reply_type=='text'" class="control-group">
                <label class="control-label v-top" style="width: 150px;">内容:</label>
                <div class="controls">
                    <textarea rows="3" ng-model="config.rcvmsg_reply_info.content" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                </div>
            </div>
            <div ng-show="config.rcvmsg_reply_type=='image' " class="control-group">
                <label class="control-label v-top" style="width: 150px;">图片:</label>
                <div class="controls">
                    <kefu-img ng-model="config.rcvmsg_reply_info.media_id" appid="wxapp_id" apply-type="rcvmsg_reply_info"></kefu-img>
                </div>
            </div>
            <div ng-show="config.rcvmsg_reply_type=='link' ">
                <div class="control-group">
                    <label class="control-label v-top" style="width: 150px;">标题:</label>
                    <div class="controls">
                        <input ng-model="config.rcvmsg_reply_info.title" type="text" value="" class="input-xlarge">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label v-top" style="width: 150px;">消息内容:</label>
                    <div class="controls">
                        <textarea rows="3" ng-model="config.rcvmsg_reply_info.description" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label v-top" style="width: 150px;">客服二维码:</label>
                    <div class="controls">
                        <attachment owner-id="1" owner-type="item" dhf-ng-model="config.rcvmsg_reply_info.thumb_url" xtype="url" mult="false" title="Upload" use-type="png,jpeg,gif,jpg,JPG,PNG,JPEG,GIF"></attachment>
                        <img ng-src="{{config.rcvmsg_reply_info.thumb_url}}" style="width:200px;height: 170px">
                    </div>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button type="button " class="sui-btn btn-success " ng-click="kefuAdd() ">
                    <span>{{'save' | translate}}</span>
                </button>
            </div>
        </div>
    </div>
    <div ng-show="config.service_type_id ==1">
        <div>
            <ul class="sui-breadcrumb">
                <li class="active" style="color: #212020;">扫码自动回复消息</li>
                <li class="active" ng-show="config.service_type_id ==1">
                <a href="#/kefu/wxkfadd?wxapp_id={{wxapp_id}}" class="sui-btn btn-info" style="margin-bottom:10px">新建</a>
                </li>
            </ul>
        </div>
        <table class="sui-table table-bordered">
            <thead>
                <tr>
                    <th>#</th>
                    <th>{{'事件类型'|translate}}</th>
                    <th>{{'场景类型'|translate}}</th>
                    <th>{{'标签'|translate}}</th>
                    <th>{{'备注'|translate}}</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="wxkfinfo in wxkflist" ng-if="wxkflist.length>0">
                    <td>{{wxkfinfo.kf_id}}
                    </td>
                    <td>
                        <wx-event ng-model="wxkfinfo.event" stype='1'></wx-event>
                    </td>
                    <td>
                        <wx-eventkey-type ng-model="wxkfinfo.eventtype" stype='1'></wx-eventkey-type>
                    </td>
                    <td>
                        <wx-tags-list ng-model="wxkfinfo.tag" wxappid="wxapp_id" stype="1"></wx-tags-list>
                    </td>
                    <td>
                        {{wxkfinfo.desc}}
                    </td>
                    <td>
                        <a href="#/kefu/wxkfadd?wxapp_id={{wxapp_id}}&kf_id={{wxkfinfo.kf_id}}" class="sui-btn btn-info">编辑</a>
                        <button type="button " class="sui-btn btn-danger" ng-click="delkf(wxkfinfo.kf_id) ">
                            {{'删除' | translate}}
                        </button>
                        <button type="button " class="sui-btn btn-success" ng-click="eventbackcall(wxkfinfo.eventkey) ">
                            {{'生成二维码' | translate}}
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <!-- </form> -->
</div>